<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core">
<h:head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>mymsgro</title>
	<link rel="stylesheet" type="text/css" href="css/main.css" />
	<link rel="stylesheet" type="text/css" href="css/meniu.css" />
	<link rel="stylesheet" type="text/css" href="css/style.css" />

</h:head>
<h:body>

	<ui:include src="header.xhtml" />

	<h:panelGroup layout="block" id="content">

		<ui:include src="leftMenu.xhtml" />

		<h:panelGroup layout="block" id="contenRight">
<f:event type="preRenderView" listener="#{topicBean.preRenderView}"/>
			<h:panelGroup layout="block" id="header" style="margin-top: 20px;">
				<ul>
					<li id="selected"><a>Topic</a></li>
				</ul>
			</h:panelGroup>

			<h:panelGroup layout="block" id="contentTab">
				<h:form>
					<h:panelGrid columns="3">
						<h:commandButton style="width:50px; height:30px;"
							image="resources/img/back-button.png" action="surveyCreate"></h:commandButton>
						<h:outputText value=" "></h:outputText>
						<h:outputText value=" "></h:outputText>


						<h:outputText value="Category: " />
						<h:selectOneMenu value="#{topicDTO.idCategory}"
							styleClass="comboBoxSurveyBorder100">
							<f:selectItems value="#{topicBean.categories}" var="category"
								itemLabel="#{category.name}" itemValue="#{category.id}" />
						</h:selectOneMenu>
						<h:commandButton style="width: 22px;" value="Create category"
							image="resources/img/add-icon-button-hi.png"
							action="createCategory.xhtml"></h:commandButton>


						<h:outputText value="Subcategory:" />
						<h:selectOneMenu value="#{topicDTO.idSubcategory}"
							styleClass="comboBoxSurveyBorder100">
							<f:selectItems value="#{topicBean.subcategories}"
								var="subcategory" itemLabel="#{subcategory.name}"
								itemValue="#{subcategory.id}" />
						</h:selectOneMenu>
						<h:commandButton style="width: 22px;" value="Create category"
							image="resources/img/add-icon-button-hi.png"
							action="createSubcategory.xhtml"></h:commandButton>


						<h:outputText value=" "></h:outputText>
						<h:commandButton value="Save" action="#{topicBean.createTopic}"
							styleClass="buttonSurvey2" />
						<h:outputText value=" "></h:outputText>

					</h:panelGrid>
					<h:outputText value="Topic already exists!" styleClass="inputError"
						rendered="#{topicBean.alreadyCreated}" />
				</h:form>
			</h:panelGroup>
		</h:panelGroup>
	</h:panelGroup>
</h:body>

</html>